import Vue from 'vue'
import Router from 'vue-router'

//登录
import XLoginPage from '@/pages/login/XLoginPage'

//主入口
import main from '@/pages/Main'
//pages
import XMoviePage from '@/pages/movie/XMoviePage'
import XReservePage from '@/pages/reserve/XReservePage'
import XGoodsPage from '@/pages/goods/XGoodsPage'
import XMemberPage from '@/pages/member/XMemberPage'
import XSavePage from '@/pages/save/XSavePage'
import XSaveDetailPage from '@/pages/save/XSaveDetailPage'
import XOrderPage from '@/pages/order/XOrderPage'

// 双屏
import XDoubleViewPage from '@/pages/doubleView/XDoubleViewPage'
Vue.use(Router)

export default new Router({
	routes: [
		{
			path: '/',
			name: 'login',
			component: XLoginPage,
		},
		// 双屏
		{
			path: '/doubleView',
			name: 'doubleView',
			component: XDoubleViewPage
		},
		// pages
		{
			path: '/main',
			name: 'main',
			component: main,
			redirect: '/main/movie',
			children: [
				{
					path: '/main/movie',
					name: 'XMoviePage',
					component: XMoviePage
				},
				{
					path: '/main/reserve',
					name: 'XReservePage',
					component: XReservePage
				},
				{
					path: '/main/goods',
					name: 'XGoodsPage',
					component: XGoodsPage
				},
				{
					path: '/main/member',
					name: 'XMemberPage',
					component: XMemberPage
				},
				{
					path: '/main/save',
					name: 'XSavePage',
					component: XSavePage
				},
				{
					path: '/main/saveDetail',
					name: 'XSaveDetailPage',
					component: XSaveDetailPage
				},
				{
					path: '/main/XOrderPage',
					name: 'XOrderPage',
					component: XOrderPage
				}
			]
		},
		{ path: '*', component: XLoginPage }
	]
})
